#ifndef __MAINVEINFINDER__H
#define __MAINVEINFINDER__H
#include "Image.h"
#include "VeinWalker.h"
#include "Point.h"
class MainVeinFinder {
public:
	MainVeinFinder(Image *pImage) : m_pImage(pImage) {}
	void FindMainVein(const VeinWalker::Criteria *pCrit, S32 nVeinForcedMain);
	void FindMainVeinFromPoint(const VeinWalker::Criteria *pCrit, Point<F64> ptSpawn);
	void GetVeinInfo(VeinWalker::Info *pVeinInfo) { *pVeinInfo = m_veinInfo; }
	Point<F64> GetSearchStartPoint() { return m_searchStartPoint; }
private:
	F64 GetMainVeinInfoAndScoreFromPoint(const VeinWalker::Criteria *pCrit, Point<F64> ptSpawn,
	                                     VeinWalker::Info *pInfo);
	static F64 CalculateMainVeinScore(F64 nImageWidth, F64 nImageHeight, 
                                          F64 nDistance, F64 nAverageThickness);
	Image *m_pImage;
	VeinWalker::Info m_veinInfo;
	Point<F64> m_searchStartPoint;
};
#endif//__MAINVEINFINDER__H
